/**
 * tigerrad
 * fall 2006
 */

#ifndef _ENTITY_H
#define _ENTITY_H

#include "Util.h"

#include "Model.h"

/**
 * An object in the Scene.
 */
class Entity
{
	public:
		/**
		 * Constructor.
		 * Entity instances can share Model instances.
		 */
		Entity(ModelPtr model) : 
			_model(model), 
			_pos(0.0, 0.0, 0.0), _scale(1.0, 1.0, 1.0),
			_angle(0.0), _axis(0.0, 1.0, 0.0), _rotSpeed(0.0)
		{ }

		/**
		 * Return the Model.
		 */
		ModelPtr getModel() const { return _model; }

		/**
		 * Get, set the entity position.
		 */
		Vec3 getPosition() { return _pos; }
		void setPosition(const Vec3& p) { _pos = p; }

		/**
		 * Get, set the scale.
		 */
		Vec3 getScale() { return _scale; }
		void setScale(const Vec3& s) { _scale = s; }

		/**
		 * Get, set the rotation angle, axis, speed.
		 */
		float getRotAngle() { return _angle; }
		void setRotAngle(float angle) { _angle = angle; }

		Vec3 getRotAxis() { return _axis; }
		void setRotAxis(const Vec3& a) { _axis = a; }

		float getRotSpeed() { return _rotSpeed; }
		void setRotSpeed(float s) { _rotSpeed = s; }

	protected:
		/**
		 * The Model for this Entity.  Can be shared with other Entity instances.
		 */
		ModelPtr _model;
		Vec3 _pos;
		Vec3 _scale;
		float _angle;
		Vec3 _axis;
		float _rotSpeed;
};

typedef boost::shared_ptr<Entity> EntityPtr;

#endif

